// JavaScript Document
var t = n = 0, count;
$(document).ready(function() {
	count = $("#slider_list a").length;
	$("#slider_list a:not(:first-child)").hide();
	//$("#slider_info").html($("#slider_list a:first-child").find("img").attr('alt'));
	$("#slider_info").click(function() {
		window.open($("#slider_list a:first-child").attr('href'), "_blank")
	});
	$("#slider li").click(function() {
		var i = $(this).text() - 1; //获取Li元素内的值，即1，2，3，4
		//$("#slider_info").html($("#slider_list a").eq(i).find("img").attr('alt'));
		//$("#slider_info").unbind().click(function(){window.open($("#slider_list a").eq(i).attr('href'), "_blank")})
		$("#slider_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
		document.getElementById("slider").style.background="";
		$(this).toggleClass("on");
		$(this).siblings().removeAttr("class");
		});
		t = setInterval("showAuto()", 7000);
		$("#slider").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 4000);
	});
})
		
function showAuto() {
	n = n >=(count - 1) ? 0 : ++n;
	$("#slider li").eq(n).trigger('click');
}